package com.example.SpringBootMybatis.service;

import com.example.SpringBootMybatis.entity.Gene;
import com.example.SpringBootMybatis.entity.GeneScore;
import com.example.SpringBootMybatis.entity.Params;
import com.example.SpringBootMybatis.mapper.GeneMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GeneService {
    @Resource
    private GeneMapper geneMapper;
    public PageInfo<Gene> findBySearch(Params params){
        PageHelper.startPage(params.getPageNum(),params.getPageSize());
        List<Gene> list=geneMapper.findBySearch(params);
        return PageInfo.of(list);
    }
    public PageInfo<GeneScore> findAll(Params params){
        PageHelper.startPage(params.getPageNum(),params.getPageSize());
        List<GeneScore> list=geneMapper.findAll(params);
        return PageInfo.of(list);
    }
}



